/**  
* @Title: CityController.java  
* @Description: TODO(用一句话描述该文件做什么)  
* @author 张鑫
* @phone 17561783855  
* @date 2019年4月1日  
*/
package com.fortune.rainshine.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fortune.rainshine.common.service.CityService;
import com.fortune.rainshine.service.controller.ShopController;
import com.fortune.rainshinecommon.base.CityModel;
import com.fortune.rainshinecommon.base.MsgModel;
import com.fortune.rainshinecommon.enums.ResultCode;

/**  
* @ClassName: CityController  
* @Description: TODO(省市区数据接口)  
* @author 张鑫
* @phone 17561783855
* @date 2019年4月1日  
*    
*/
@Controller
@RequestMapping("/area")
public class CityController {
	private final static Logger logger = LoggerFactory.getLogger(ShopController.class);
	@Autowired
    private CityService service;
	
	@ResponseBody
    @RequestMapping(value = "/areaList", method = RequestMethod.POST)
    public MsgModel getAreaList(@RequestBody CityModel model) {
        try {
        	return service.getAreaList(model);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e.toString());
			return new MsgModel(ResultCode.FAILURE);
		}
    }
}
